<extend name="public@base"/>
block(name='main')
    .wrap
        ul.nav.nav-tabs
            li.nav-item: a.nav-link(href="{:url('Menu/index')}") 后台菜单
            li.nav-item: a.nav-link(href="{:url('Menu/add')}") 添加菜单
            li.nav-item: a.nav-link(href="{:url('Menu/lists')}") 所有菜单
            li.nav-item: a.nav-link.active 编辑菜单
        form.form-horizontal.js-ajax-form.margin-top-20(method='post', action="{:url('menu/editPost')}")
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-parent_id')
                    span.form-required 
                    | 上级
                .col.col-lg-6
                    select#input-parent_id.form-control(name='parent_id')
                        option(value='0') 作为一级菜单
                        |{$select_category}
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-name')
                    span.form-required 
                    | 名称
                .col.col-lg-6
                    input#input-name.form-control(type='text', name='name', value='{$data.name}')
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-app')
                    span.form-required 
                    | 应用
                .col.col-lg-6
                    input#input-app.form-control(type='text', name='app', value='{$data.app}')
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-controller')
                    span.form-required 
                    | 控制器
                .col.col-lg-6
                    input#input-controller.form-control(type='text', name='controller', value='{$data.controller}')
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-action')
                    span.form-required 
                    | 方法
                .col.col-lg-6
                    input#input-action.form-control(type='text', name='action', value='{$data.action}')
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-param') 参数
                .col.col-lg-6
                    input#input-param.form-control(type='text', name='param', value='{$data.param}')
                    p.help-block 例:id=3&p=3
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-icon') 图标
                .col.col-lg-6
                    input#input-icon.form-control(type='text', name='icon', value='{$data.icon}')
                    small.text-muted
                        a(href='http://www.thinkcmf.com/font/font_awesome/icons.html', target='_blank') 选择图标
                        .text-muted 不带前缀fa-，如fa-user => user
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-remark') 备注
                .col.col-lg-6
                    textarea#input-remark.form-control(name='remark') {$data.remark}
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-status') 状态
                #input-status.col.col-lg-6
                    select.form-control(name='status')
                        option(value='1') 在左侧菜单显示
                        php $status_selected=empty($data['status'])?"true":"false";
                        option(value='0', data-selected="{$status_selected}") 在左侧菜单隐藏
            .form-group.form-row
                label.col-2.col-form-label.text-right(for='input-type') 类型
                .col.col-lg-6
                    select#input-type.form-control(name='type')
                        option(value='1') 有界面可访问菜单
                        php $type2_selected=$data['type']==2?"true":"false";
                        option(value='2', data-selected='{$type2_selected}') 无界面可访问菜单
                        php $type_selected=$data['type']==0?"true":"false";
                        option(value='0', data-selected="{$type_selected}") 只作为菜单
            .form-group.form-row
                .col-auto.offset-lg-2
                    input(type='hidden', name='id', value='{$data.id}')
                    button.btn.btn-sm.btn-primary.js-ajax-submit(type='submit') {:lang('SAVE')}
                    a.btn.btn-sm.btn-default(href="{:url('menu/index')}") {:lang('BACK')}
